var express = require('express');
var router = express.Router();
var chatController = require('../controllers/chatController')
var passport=require('passport');
/* GET home page. */
// 已收藏内容(typeid==0套餐)
router.get('/collect0',passport.authenticate('jwt',{session:false}), function (req, res, next) {
   chatController.collectZero(req,res) 
});

// 已收藏内容(typeid==1老人)
router.get('/collect1',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.collectOne(req,res) 
 });

 // 已收藏内容(typeid==2分享)
router.get('/collect2',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.collectTwo(req,res) 
 });

//添加套餐到收藏
router.post('/addcollect',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.collectAdd(req,res)
});

//删除已收藏
router.delete('/collect/:collectId',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.collectDelete(req,res)
});

//已评论内容
router.get('/comment/:typeId/:commentType', function (req, res, next) {
    chatController.getComment(req,res)
});

//发表评论
router.post('/upComment',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.upComment(req,res)
});

//删除已发表的评论
router.delete('/delComment/:commentId',passport.authenticate('jwt',{session:false}), function (req, res, next) {
    chatController.delComment(req,res)
})

module.exports = router;
